<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div class="box" ondblclick="getEvent(event)">事件对象</div>
  </body>
  <script>
    var oBox = document.querySelector(".box");
    oBox.onclick = function (e) {
      console.log(e);

      console.log(e.target);
      //对获取到的节点进行操作（单击文本后变色）
      e.target.style.color = "aqua";

      console.log("事件名为" + e.type);

      console.log("事件处于第几阶段" + e.eventPhase);

      console.log(e.preventDefault());//undefined

      console.log(e.stopPropagation());//undefined
    };

    function getEvent(e) {
      console.log(e);
    }
  </script>
</html>
